package jvm;

import sun.misc.Unsafe;

import java.nio.ByteBuffer;
import java.util.Scanner;

public class TestDirectMemory {
    private final static int _1GB=1024*1024*1024;
    private static Scanner scanner=new Scanner(System.in);
    public static void main(String[] args) {
        ByteBuffer byteBuffer = ByteBuffer.allocateDirect(_1GB);
//        byte[] byteBuffer = new byte[_1GB];
        System.out.println("...");
        scanner.next();
        System.out.println("正在gc...");
        byteBuffer=null;
        System.gc();
        scanner.next();
    }
}
